package com.bootdo.clouddo.service.juejin.impl;

import com.bootdo.clouddo.utils.http.JuejinUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.clouddo.dao.juejin.UserDao;
import com.bootdo.clouddo.domain.juejin.UserDO;
import com.bootdo.clouddo.service.juejin.IJuejinUserService;

@Service()
public class JuejinUserServiceImpl implements IJuejinUserService {
	
	@Autowired
	private UserDao dao;

	@Override
	public int save(UserDO user) {
		return dao.insertSelective(user);
	}

	@Override
	public UserDO get(String id) {
		UserDO user = dao.selectByPrimaryKey(id);
		if(user == null)
			return user;
		user.setAvatarLarge(JuejinUtils.getNewImageHost(user.getAvatarLarge()));
		return user;
	}
	
	

}
